Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

419
Views
Generating blob and downloading it on production redirects to [object%20Object] and showing AWS error page

I wrote the following function that receives headers, values and a fileName as params:

export function generateAndDownloadCsv(headers: string[], values: string[][], fileName: string) {
  let body = headers.join(',') + '\n';

  for (const row of values) {
    body += row.join(',') + '\n';
  }

  const csvFile = new Blob([body], {type: 'text/csv'});
  const a = document.createElement('a');
  a.download = fileName;
  a.href = window.URL.createObjectURL(csvFile);
  a.style.display = 'none';
  document.body.appendChild(a);
  a.click();
  document.body.removeChild(a);
}

Everything works fine, downloads the CSV file in local environment. However, when deploying to our test environment which is using cloudfront that fetches the frontend from S3.

When downloading it on test environment, I get redirected to https://url.com/[object%20Object] and I see the following page:

enter image description here

The generated blob URL looks like: blob:https://my-site-dot-com/f93c0768-2e57-424f-85fc-0ad5417f6f12

Is this a code related issue or host issue, has anyone ever faced something like this?

I think it something that has to do with the cloudfront, with the URL.

Thank you!

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!